#!/bin/bash
###########################################################
#                                                         #                  
#  Released under the GNU Public License                  #                  
#                                                         #                  
#  Script   :  echo_disable                               #
#  Author   :  Marcus Xenakis WA2DCI                      #
#  Version  :  .13 Beta                                   #
#  Date     :  3/15/03                                    #
#  About    :  This sripts disables EchoLink              #  
#  Modified :  3/15/03 to use forcekey/forceunkey         #
#                                                         #
###########################################################

[ -z "$ECHO_SCRIPT" ] && ECHO_SCRIPT=/home/EchoIRLP/scripts
   source $ECHO_SCRIPT/echo_common

# Exits if node is not enabled
if [ -f "$LOCAL"/echo_enable ] ; then 

  rm "$LOCAL"/echo_enable
  "$BIN"/forcekey
  usleep ${TXDELAY:-250000}
  play "$ECHO_AUDIO"/echodisabled.wav
  usleep 250000
  "$BIN"/forceunkey
  "$ECHO_SCRIPT"/echo_status
else 

  echo "${0##*/}: The node is already disabled."
     
fi

exit 0
